﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" 
CodeBehind="Publications.aspx.cs" Inherits="ElectronicJournal.Account.EditorAccount.Publications" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <style type="text/css">
        .button 
        {
            cursor : pointer;
            display: inline-block;
	        outline: none;
	        cursor: pointer;
	        text-align: center;
	        text-decoration: none;
	        font: 14px/100% Arial, Helvetica, sans-serif;
	        text-shadow: 0 1px 1px rgba(0,0,0,.3);
	        -webkit-border-radius: .5em; 
	        -moz-border-radius: .5em;
	        border-radius: .5em;
	         border-width 2px;
	        border-color: #009999;
	        -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.2);
	        -moz-box-shadow: 0 1px 2px rgba(0,0,0,.2);
	        box-shadow: 0 1px 2px rgba(0,0,0,.2);
        }
        .button:hover {
	        text-decoration: none;
        }
        .button:active {
	        position: relative;
	        top: 1px;
        }
        .radius {
            background: #f0f0f0; /* Цвет фона */
            border: 4px solid #009999; /* Параметры рамки */
            padding: 7px; /* Поля вокруг текста */
            margin-bottom: 7px; /* Отступ снизу */
         }
    </style>

    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ApplicationServices %>" 
        SelectCommand="SELECT [dbo].[aspnet_Roles].RoleId, [dbo].[aspnet_UsersInRoles].UserId, [dbo].[aspnet_UsersInRoles].RoleId, [dbo].[aspnet_Users].UserName FROM [dbo].[aspnet_Roles], [dbo].[aspnet_UsersInRoles],  [dbo].[aspnet_Users]  WHERE [dbo].[aspnet_Roles].RoleName = 'Reviewer' AND [dbo].[aspnet_UsersInRoles].RoleId = [dbo].[aspnet_Roles].RoleId AND  [dbo].[aspnet_Users].UserId = [dbo].[aspnet_UsersInRoles].UserId">
        </asp:SqlDataSource>

    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ApplicationServices %>" 
        SelectCommand="SELECT Publications.TitleRussian, Publications.State, Publications.Id FROM Publications WHERE State = 1 OR State = 3 OR State = 5" />

    <asp:SqlDataSource ID="SqlDataSource3" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ApplicationServices %>" 
        SelectCommand="SELECT Reviewer.ReviewerFirstName, Reviewer.ReviewerLastName, Reviewer.ReviewerThirdName, ScientificDirections.Title, Reviewer.ReviewerPhoneNumber, Reviewer.ReviewerEmail, Reviewer.ReviewerId FROM Reviewer, ScientificDirections WHERE Reviewer.ReviewerResearchArea = ScientificDirections.Id"></asp:SqlDataSource>

    <asp:SqlDataSource ID="SqlDataSource4" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ApplicationServices %>" 
        SelectCommand="SELECT Author.AuthorFirstName, Author.AuthorSecondName, Author.AuthorThirdName, Author.AuthorUserId, Author.AuthorPhoneNumber, Author.AuthorEmail, AuthorToPub.AuthorId FROM Author, AuthorToPub WHERE Author.AuthorId = AuthorToPub.AuthorId AND AuthorToPub.PubId = @PublicationId">
        <SelectParameters>
            <asp:Parameter Name="PublicationId" Type="String" />
        </SelectParameters>
    </asp:SqlDataSource>
    <asp:Panel ID="PublicationListPanel" runat="server" Visible="true">
        <a href="Default.aspx">Меню редактора</a>
        <div width="500px" style="border-radius: 8px;" class="radius" bgcolor="#009999">
        <b>НЕПРОСМОТРЕННЫЕ ПУБЛИКАЦИИ</b>
        <asp:GridView ID="GridView1" runat="server" DataSourceID="SqlDataSource2" 
            DataKeyNames="Id"
            AutoGenerateColumns="False" BorderStyle="None"
            onselectedindexchanged="GridView1_SelectedIndexChanged" CellPadding="0" 
            ForeColor="#333333" Width="100%">
            <Columns>
                <asp:BoundField HeaderText="Заголовок" DataField="TitleRussian" SortExpression="Title" />
                <asp:CommandField SelectText="Открыть" ShowSelectButton="true" />
            </Columns>
            <FooterStyle BackColor="#009999" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#009999" Font-Bold="True" ForeColor="White" />
        </asp:GridView>
        </div>
    </asp:Panel>
    
    <asp:Panel ID="PublicationDetailsPanel" runat="server" Visible="false">
        <div width="500px" style="border-radius: 8px;" class="radius" bgcolor="#009999">
            <asp:Label ID="CurrentPublicationId" Visible="false" runat="server" Text="" />
            <asp:Label ID="Label1" Visible="false" runat="server" Text="" />
            <div>
            <table runat="server" ID="PublicationInfoPanel1">
                <tbody>
                    <tr>
                        <td>
                            <asp:LinkButton runat="server" Text="К списку публикаций" OnClick="GoToPublicationsList"  />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <b>Название публикации на русском языке:</b>
                        </td>
                        <td>
                            <asp:Label ID="TitleRussianLabel" runat="server"/>   
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <b>Название публикации на английском языке:</b>
                        </td>
                        <td>
                            <asp:Label ID="TitleEnglishLabel" runat="server" />   
                        </td>
                    </tr>
                </tbody>
            </table>
            <table runat="server" ID="PublicationInfoPanel2">
                <tbody>
                    <tr>
                        <td>
                            <b>Авторы:</b>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:GridView runat="server" ID="AuthorsGridview" AutoGenerateColumns="False" 
                                DataSourceID="SqlDataSource4" CellPadding="0" ForeColor="#333333" >
                                <Columns>
                                    <asp:BoundField DataField="AuthorFirstName" HeaderText="Фамилия" 
                                        SortExpression="AuthorFirstName" />
                                    <asp:BoundField DataField="AuthorSecondName" HeaderText="Имя" 
                                        SortExpression="AuthorSecondName" />
                                    <asp:BoundField DataField="AuthorThirdName" HeaderText="Отчество" 
                                        SortExpression="AuthorThirdName" />
                                    <asp:BoundField DataField="AuthorPhoneNumber" HeaderText="Телефон" 
                                        SortExpression="AuthorPhoneNumber" />
                                    <asp:BoundField DataField="AuthorEmail" HeaderText="Email" 
                                        SortExpression="AuthorEmail" />
                                </Columns>
                                <FooterStyle BackColor="#009999" Font-Bold="True" ForeColor="White" />
                                <HeaderStyle BackColor="#009999" Font-Bold="True" ForeColor="White" />
                            </asp:GridView>   
                        </td>
                    </tr>
                </tbody>
            </table>
            <br />
            <table runat="server" ID="PublicationInfoPanel3">
                <tbody>
                    <tr>
                        <td>
                            <b>Научное направление:</b>
                        </td>
                        <td>
                            <asp:Label runat="server" ID="ScientificDirectionLabel" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <b>Тип публикации:</b>
                        </td>
                        <td>
                            <asp:Label ID="TypeLabel" runat="server" />   
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <b>Индекс УДК:</b>
                        </td>
                        <td>
                            <asp:Label ID="UDCIndexLabel" runat="server" />   
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <b>Специальность:</b>
                        </td>
                        <td>
                            <asp:Label ID="SpecialityLabel" runat="server" />  
                             <br /> 
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <b>Резюме на русском языке:</b>
                        </td>
                        <td>
                            <asp:TextBox EnableViewState="false" runat="server" ID="SummaryRussianTextBox" TextMode="MultiLine" Width="400px" Height="100px"/>  
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <b>Резюме на английском языке:</b>
                        </td>
                        <td>
                            <asp:TextBox EnableViewState="false" runat="server" ID="SummaryEnglishTextBox" TextMode="MultiLine" Width="400px" Height="100px"/>  
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <b>Ключевые слова на русском языке:</b>
                        </td>
                        <td>
                            <asp:TextBox EnableViewState="false" runat="server" ID="KeywordRussianTextBox" TextMode="MultiLine" Width="400px" Height="50px"/>  
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <b>Ключевые слова на английском языке:</b>
                        </td>
                        <td>
                            <asp:TextBox EnableViewState="false" runat="server" ID="KeywordEnglishTextBox" TextMode="MultiLine" Width="400px" Height="50px"/>  
                        </td>
                    </tr>
                    <tr>
                        <td>
                            
                        </td>
                        <td>
                            <asp:LinkButton ID="FileArtickeLinkButton" Text="Файл публикации" runat="server" OnClick="FileArticleLinkButton_Click"/>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            
                        </td>
                        <td>
                            <asp:LinkButton ID="FileLetterLinkButton" Text="Скан сопроводительного письма" runat="server" OnClick="FileLetterLinkButton_Click"/>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            
                        </td>
                        <td>
                            <asp:LinkButton ID="FileExpertLinkButton" Text="Скан экспертного заключения" runat="server" OnClick="FileExpertLinkButton_Click"/>
                        </td>
                    </tr>
                    <tr>
                        <td>
                        
                        </td>
                    </tr>
                    <tr>
                        <td>
                            
                        </td>
                        <td>
                            <asp:Label runat="server" ID="ReceiptNumberLabel" />
                            <asp:LinkButton runat="server" ID="ReceiptScanLinkButton" Text="Квитанция об оплате" OnClick="RecieptScanLinkButton_Click" />
                            <asp:Button ID="PaidButton" runat="server" Text="Подтвердить оплату" OnClick="SetStatePaid" />
                        </td>
                    </tr>
                </tbody>
            </table>
            <table ID="ReviewPanel" runat="server">
                <tbody>
                    <tr>
                        <td>
                            <b>Выбрать рецензента:</b>
                        </td>
                    </tr>
                    <tr>
                        <td>
                        <asp:GridView runat="server" ID="ReviewersGridView" AutoGenerateColumns="False" 
                            DataKeyNames="ReviewerId" DataSourceID="SqlDataSource3" 
                                OnSelectedIndexChanged="SendPublicationToReviewer" CellPadding="0" 
                                ForeColor="#333333" Width="580px" Font-Size="11px">
                            <Columns>
                                <asp:BoundField DataField="ReviewerFirstName" HeaderText="Фамилия" 
                                    SortExpression="ReviewerFirstName" />
                                <asp:BoundField DataField="ReviewerLastName" HeaderText="Имя" 
                                    SortExpression="ReviewerLastName" />
                                <asp:BoundField DataField="ReviewerThirdName" HeaderText="Отчество" 
                                    SortExpression="ReviewerThirdName" />
                                <asp:BoundField DataField="Title" 
                                    HeaderText="Научная область" SortExpression="Title" />
                                <asp:BoundField DataField="ReviewerPhoneNumber" 
                                    HeaderText="Телефон" SortExpression="ReviewerPhoneNumber" />
                                <asp:BoundField DataField="ReviewerEmail" HeaderText="Email" 
                                    SortExpression="ReviewerEmail" />
                                <asp:BoundField DataField="ReviewerId" HeaderText="ReviewerId" 
                                    InsertVisible="False" ReadOnly="True" SortExpression="ReviewerId" Visible="false"/>
                                <asp:CommandField SelectText="Отправить на рецензию" ShowSelectButton="true" />
                            </Columns>
                            <FooterStyle BackColor="#009999" Font-Bold="True" ForeColor="White" />
                            <HeaderStyle BackColor="#009999" Font-Bold="True" ForeColor="White" />
                        </asp:GridView>
                        </td>
                    </tr>
                </tbody>
            </table>
            <table ID="ReviewFilePanel" runat="server">
                <tbody>
                    <tr>
                        <td>
                            
                        </td>
                        <td>
                            <asp:LinkButton runat="server" ID="FileReviewLinkButton" Text="Файл рецензии" OnClick="FileReviewLinkButton_Click"/>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Button ID="Button1" runat="server" Text="Принять публикацию" OnClick="SetPublicationStateReady"/>
                        </td>
                        <td>
                            <asp:Button ID="Button2" runat="server" Text="Вернуть на доработку" OnClick="SendPublicationToAuthor"/>
                            <asp:Button ID="Button3" runat="server" Text="Отклонить публикацию" />
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>
    </asp:Panel>
    
</asp:Content>
